#ifndef LOGIN_H
#define LOGIN_H

#include <QWidget>
#include <QNetworkAccessManager>
#include <QLineEdit>
#include "pages/ChatInterface.h"
#include <request/userequest.h>

QT_BEGIN_NAMESPACE

namespace Ui {
class Login;
}
QT_END_NAMESPACE

class Login : public QWidget
{
    Q_OBJECT

public:

    Login(QWidget *parent = nullptr);

    ~Login();

    void mouseMoveEvent(QMouseEvent *);

    void mousePressEvent(QMouseEvent *);

private slots:

    void on_loginButton_clicked();

    void requestFinished(QJsonObject obj);

    void on_pushButton_clicked();

    void on_toolButton_3_clicked();

    void on_pushButton_2_clicked();

    void loginFinished(QJsonObject obj);

    void on_regButton_clicked();

    void on_toolButton_2_clicked();

    void on_toolButton_clicked();

    void on_toolButton_4_clicked();

private:

    ChatInterface *page = nullptr;

    UserRequest *user_request = nullptr;

    bool is_drag = false;

    QPoint start_pos;

    Ui::Login *ui;

};
#endif // LOGIN_H
